import threading


''' 多线程并发问题 '''


def add():
    global count 
    a = count + 1
    print(count)
    count = a

count = 0
times = 100000  # 累加次数

if __name__ == '__main__':
    threads = []
    for i in range(times):
        a = threading.Thread(target=add)
        threads.append(a)
    for i in threads:
        i.start()
    for i in threads:
        i.join()
    print(f'count 累加{times}次， 最后得到', count)